<HTML>
<HEAD>
<TITLE>[Chapter 22] java.awt.image Reference</TITLE>
<META NAME="author" CONTENT="John Zukowski">
<META NAME="date" CONTENT="Thu Jul 31 15:24:53 1997">
<META NAME="form" CONTENT="html">
<META NAME="metadata" CONTENT="dublincore.0.1">
<META NAME="objecttype" CONTENT="book part">
<META NAME="otheragent" CONTENT="gmat dbtohtml">
<META NAME="publisher" CONTENT="O'Reilly &amp; Associates, Inc.">
<META NAME="source" CONTENT="SGML">
<META NAME="subject" CONTENT="Java AWT">
<META NAME="title" CONTENT="Java AWT">
<META HTTP-EQUIV="Content-Script-Type" CONTENT="text/javascript">
</HEAD>
<body vlink="#551a8b" alink="#ff0000" text="#000000" bgcolor="#FFFFFF" link="#0000ee">
<script language='JavaScript'>
<!--
if (location.replace) {
 location.replace ('ch22_js.htm');
}
// -->
</script>

<DIV CLASS=htmlnav>
<H1><a href='index.htm'><IMG SRC="gifs/smbanner.gif"
     ALT="Java AWT" border=0></a></H1>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch21_30.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><B><FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1">Chapter 22</FONT></B></TD>
<td width=172 align=right valign=top><A HREF="ch22_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
</table>

&nbsp;
<hr align=left width=515>
</DIV>
<H1 CLASS=chapter><A CLASS="TITLE" NAME="JAWT-CH-22">22. java.awt.image Reference</A></H1>

<DIV CLASS=htmltoc>

<p>
<b>Contents:</b><br>
<a href='ch22_02.htm'>ColorModel</a><br>
<a href='ch22_03.htm'>CropImageFilter</a><br>
<a href='ch22_04.htm'>DirectColorModel</a><br>
<a href='ch22_05.htm'>FilteredImageSource</a><br>
<a href='ch22_06.htm'>ImageConsumer</a><br>
<a href='ch22_07.htm'>ImageFilter</a><br>
<a href='ch22_08.htm'>ImageObserver</a><br>
<a href='ch22_09.htm'>ImageProducer</a><br>
<a href='ch22_10.htm'>IndexColorModel</a><br>
<a href='ch22_11.htm'>MemoryImageSource</a><br>
<a href='ch22_12.htm'>PixelGrabber</a><br>
<a href='ch22_13.htm'>ReplicateScaleFilter <img src="gifs/bstar.gif" alt="(New)" border=0></a><br>
<a href='ch22_14.htm'>RGBImageFilter</a><br>
<p>
<p>
</DIV>

<DIV CLASS=refnamediv>
<H1>AreaAveragingScaleFilter <img src="gifs/bstar.gif" alt="(New)" border=0></H1>

<H2>Name</H2>

AreaAveragingScaleFilter <img src="gifs/bstar.gif" alt="(New)" border=0>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.1"></A></h2>
</DIV>


<p>
<img align=middle src="./figs/areaave.gif" alt="[Graphic: Figure from the text]" width=503 height=93 border=0>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.2">Description</A></h2>

<P CLASS=para>
The <tt CLASS=literal>AreaAveragingScaleFilter</tt> class 
scales an image using a simple smoothing algorithm. 

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.3">Class Definition</A></h2>

<DIV CLASS=screen>
<P>
<PRE>
public class java.awt.image.AreaAveragingScaleFilter
    extends java.awt.image.ReplicateScaleFilter {
  // Constructor
  public AreaAveragingScaleFilter (int width, int height);
  // Instance Methods
  public void setHints (int hints);
  public void setPixels (int x, int y, int w, int h, ColorModel model, 
    byte[] pixels, int off, int scansize);
  public void setPixels (int x, int y, int w, int h, ColorModel model, 
    int[] pixels, int off, int scansize);
}
</PRE>
</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.4">Constructor</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.1">AreaAveragingScaleFilter</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.1">public AreaAveragingScaleFilter (int width, int height)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>width</I><br>
<DD>

<P CLASS=para>
Width of scaled image.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>height</I><br>
<DD>

<P CLASS=para>
Height of scaled image. </DL>
<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Constructs an <tt CLASS=literal>AverageScale</tt><tt CLASS=literal>Filter</tt> 
that scales the original image to the specified size. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.5">Instance Methods</A></h2>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.2">setHints</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.2">public void setHints (int hints)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>hints</I><br>
<DD>

<P CLASS=para>
Flags indicating how data will be delivered. </DL>
<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ImageFilter.setHints(int)</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Gives this filter hints about how data will be delivered. </DL>
</DIV>

</DIV>

<DIV CLASS=refsect2>
<h3 CLASS=refsect2><A CLASS="TITLE" NAME="ch22-REFSECT2-AUTOID.3">setPixels</A></h3>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.3">public void setPixels (int x, int y, int w, int h, ColorModel model, byte[] pixels, int off, int scansize)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>x</I><br>
<DD>

<P CLASS=para>
x-coordinate of top-left corner of pixel data delivered 
with this method call.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>y</I><br>
<DD>

<P CLASS=para>
y-coordinate of top-left corner of pixel data delivered 
with this method call.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>w</I><br>
<DD>

<P CLASS=para>
Width of the rectangle of pixel data delivered with 
this method call.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>h</I><br>
<DD>

<P CLASS=para>
Height of the rectangle of pixel data delivered with 
this method call.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>model</I><br>
<DD>

<P CLASS=para>
Color model of image data.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>pixels</I><br>
<DD>

<P CLASS=para>
Image data.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>off</I><br>
<DD>

<P CLASS=para>
Offset from beginning of the pixels array.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>scansize</I><br>
<DD>

<P CLASS=para>
Size of each line of data in pixels array. </DL>
<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ReplicateScaleFilter.setPixels(int, int, int, int, 
ColorModel, byte[], int, int</tt><tt CLASS=literal>)</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Receives a rectangle of image data from the <tt CLASS=literal>ImageProducer</tt>; 
scales these pixels and delivers them to any <tt CLASS=literal>ImageConsumer</tt>s. </DL>
</DIV>

<DIV CLASS=refsect3>
<h4 CLASS=refsect3><A CLASS="TITLE" NAME="ch22-REFSECT3-AUTOID.4">public void setPixels (int x, int y, int w, int h, ColorModel model, int[] pixels, int off, int scansize)</A></h4>

<DL CLASS=variablelist>
<DT CLASS=varlistentry>Parameters<br>
<DD>

<P>
<DL CLASS=variablelist>
<DT CLASS=varlistentry><I CLASS=emphasis>x</I><br>
<DD>

<P CLASS=para>
x-coordinate of top-left corner of pixel data delivered 
with this method call.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>y</I><br>
<DD>

<P CLASS=para>
y-coordinate of top-left corner of pixel data delivered 
with this method call.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>w</I><br>
<DD>

<P CLASS=para>
Width of the rectangle of pixel data delivered with 
this method call.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>h</I><br>
<DD>

<P CLASS=para>
Height of the rectangle of pixel data delivered with 
this method call.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>model</I><br>
<DD>

<P CLASS=para>
Color model of image data.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>pixels</I><br>
<DD>

<P CLASS=para>
Image data.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>off</I><br>
<DD>

<P CLASS=para>
Offset from beginning of the pixels array.

<p>
<DT CLASS=varlistentry><I CLASS=emphasis>scansize</I><br>
<DD>

<P CLASS=para>
Size of each line of data in pixels array. </DL>
<p>
<DT CLASS=varlistentry>Overrides<br>
<DD>

<P CLASS=para>
<tt CLASS=literal>ReplicateScaleFilter.setPixels(int, int, int, int, ColorModel, int[], int, int)</tt> 

<p>
<DT CLASS=varlistentry>Description<br>
<DD>

<P CLASS=para>
Receives a rectangle of image data from the <tt CLASS=literal>ImageProducer</tt>; 
scales these pixels and delivers them to any <tt CLASS=literal>ImageConsumer</tt>s. </DL>
</DIV>

</DIV>

</DIV>

<DIV CLASS=refsect1>
<h2 CLASS=refsect1><A CLASS="TITLE" NAME="ch22-REFSECT1-AUTOID.6">See Also</A></h2>

<P CLASS=para>
ColorModel, ReplicateScaleFilter 

</DIV>


<DIV CLASS=htmlnav>

<P>
<HR align=left width=515>
<table width=515 border=0 cellpadding=0 cellspacing=0>
<tr>
<td width=172 align=left valign=top><A HREF="ch21_30.htm"><IMG SRC="gifs/txtpreva.gif" ALT="Previous" border=0></A></td>
<td width=171 align=center valign=top><a href="index.htm"><img src='gifs/txthome.gif' border=0 alt='Home'></a></td>
<td width=172 align=right valign=top><A HREF="ch22_02.htm"><IMG SRC="gifs/txtnexta.gif" ALT="Next" border=0></A></td>
</tr>
<tr>
<td width=172 align=left valign=top>WindowListener <img src="gifs/bstar.gif" alt="(New)" border=0></td>
<td width=171 align=center valign=top><a href="index/idx_a.htm"><img src='gifs/index.gif' alt='Book Index' border=0></a></td>
<td width=172 align=right valign=top>ColorModel</td>
</tr>
</table>
<hr align=left width=515>

<IMG SRC="gifs/smnavbar.gif" USEMAP="#map" BORDER=0> 
<MAP NAME="map"> 
<AREA SHAPE=RECT COORDS="0,0,108,15" HREF="../javanut/index.htm"
alt="Java in a Nutshell"> 
<AREA SHAPE=RECT COORDS="109,0,200,15" HREF="../langref/index.htm" 
alt="Java Language Reference"> 
<AREA SHAPE=RECT COORDS="203,0,290,15" HREF="../awt/index.htm" 
alt="Java AWT"> 
<AREA SHAPE=RECT COORDS="291,0,419,15" HREF="../fclass/index.htm" 
alt="Java Fundamental Classes"> 
<AREA SHAPE=RECT COORDS="421,0,514,15" HREF="../exp/index.htm" 
alt="Exploring Java"> 
</MAP>
</DIV>

</BODY>
</HTML>
